package com.ruoyi.mobile.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.mobile.domain.SchoolStudentEntity;
import com.ruoyi.system.api.resp.SchoolStudentResp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DS("master")
public interface SchoolStudentMapper extends BaseMapper<SchoolStudentEntity> {
    @Select("select b.classes_name as classesName from school_student a " +
            "left join school_classes b on b.id=a.classes_id where b.amount=0 and a.student_id=#{userId}")
    public List<SchoolStudentResp> getClassInfosByUserId(@Param("userId")Long userId);
}
